package com.ty.controller;

import com.ty.entity.PermissionsQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ty.entity.Permissions;
import com.ty.service.PermissionsService;

import java.util.List;

/**
 * ;(212_permissions)控制层
 * @author : heimi
 * @date : 2025-6-13
 */
@RestController
@RequestMapping("/api/permissions")
public class PermissionsController{
    @Autowired
    private PermissionsService permissionsService;
    
    /** 
     * 查询接口
     */
     @GetMapping
     public List<Permissions> select(PermissionsQuery query){
        return permissionsService.select(query);
    }
    
    @PostMapping 
    public Integer insert(@RequestBody Permissions product){
       return permissionsService.insert(product);
    }
    
    @PutMapping 
    public Integer update(@RequestBody Permissions product){
        return permissionsService.update(product);
    }
    
    @DeleteMapping
    public Integer delete(Integer id){
        return permissionsService.delete(id);
    }
}